<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>SPARK AI</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        #chat-title {
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            padding-top: 30px;
            margin: 0;
            width: 100%;
            box-sizing: border-box;
        }

        #chat-app {
            max-width: 600px;
            margin: 30px auto;
            background: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            overflow: hidden;
        }

        #chat-window {
            padding: 20px;
            background: #e9ecef;
            height: calc(100vh - 210px);
            overflow-y: auto;
            /* 允许垂直滚动 */
            display: flex;
            flex-direction: column;
        }

        .message {
            padding: 10px;
            margin-bottom: 8px;
            border-radius: 5px;
            max-width: 70%;
            display: inline-block;
            clear: both;
            position: relative;
        }

        .user-message {
            background-color: #dee2e6;
            margin-left: auto;
        }

        .robot-message {
            background-color: #cbd5e0;
            margin-right: auto;
        }

        .message::before {
            content: '';
            position: absolute;
            border-style: solid;
            border-width: 6px;
            display: block;
            width: 0;
        }

        .user-message::before {
            top: 16px;
            right: -12px;
            border-color: transparent transparent transparent #cbd5e0;
        }

        .robot-message::before {
            top: 16px;
            left: -12px;
            border-color: transparent #dee2e6 transparent transparent;
        }

        #message-input {
            width: calc(100% - 100px);
            padding: 10px;
            border: none;
            outline: none;
            border-top: 1px solid #ccc;
        }

        #send-button {
            width: 80px;
            padding: 10px;
            background-color: #6c757d;
            color: white;
            border: none;
            cursor: pointer;
            border-top: 1px solid #ccc;
        }

        .input-container {
            display: flex;
        }
    </style>
</head>

<body>
    <div id="chat-title">SPARK AI</div>
    <div id="chat-app">
        <div id="chat-window"></div>
        <div class="input-container">
            <input type="text" id="message-input" placeholder="请输入...">
            <button id="send-button">发送</button>
        </div>
    </div>
    <script src="{{ url_for('static', filename='js/chat.js') }}"></script>
</body>

</html>
